3D Mesh Replace Tutorial (Objects)
This is the Mesh Replace tutorial for Objects only, for the hair mesh tutorial, please visit here: 3D Mesh Replace Tutorial (Hair) __TOC__ 'Introduction' Mesh Replacement in the simplest form is the following: #Import a game mesh using the TKM17 to Blender tool. #Import a mesh of your choosing #Join the your mesh with the game mesh. #Export the new combined mesh By following this tutorial, you should be able to have a good grasp on importing, editing and exporting meshes for the game. This tutorial assumes the following: -You have never used Blender before -You have at the very least already set up the TKM17 to Blender tool (Download and read carefully “Doc_v0.8.3.7z” it tells you exactly how to set everything up step-by-step) -You are using Blender v2.64 'Getting Started' Basic Blender Commands *Mouse wheel zooms in and out *Hold the Middle Mouse Button (mouse wheel or MMB) and move your mouse to rotate the camera *You select meshes with the Right Mouse Button (RMB) or you can select them under the “Scene Interface” everything else you use the Left Mouse Button (LMB) like normal. *When you have a mesh selected, TAB alternates between “Object Mode” and “Edit Mode” *CTRL + Z is undo For more information please visit: http://wiki.blender.org/index.php/Doc:2.6/Manual/3D_interaction/Navigating/3D_View I highly recommend starting up Blender, and using each of the four commands listed till your comfortable before moving on For this tutorial, we will be using a sample Teddy Bear for the object > toy replacement. It can be downloaded below: Teddy Bear: http://www.mediafire.com/download/ybydomx0dy9x4hy/teddy+bear.zip Advanced Blender Commands 1 - View *5 - Perspective /Iso view *7 - Top view *1 - Front view *3 - Right view *2,4,6,8 - rotate view *Home - Zoom extend *, - Zoom to selection 2 - Navigation *G - Move *S - Scale *R - Rotate *H - hide ; Alt +H unhide *X - erase *A - Select/Unselect all 2 - Hide/Show Toolbar *N - Propertiers (Move, Rotate, Scale, Display) *T - Tools 3 - Window Type *Shift + **F10 Uv Editor **F5 3d View 'Importing' Object > Toy Mesh Replacement Tutorial First, start up Blender, right click the Cube and delete it because we don't need it. Next, go to file>Save As... and save it as Teddy Bear and save it as a blend file. You have to do this so you are able to import the game files (as shown below) Now, your import tab should no longer be grayed out. 1 Under type/select a filename, type in tool09 (corn) and click the green checkmark button. Blender should now import the corn mesh into the screen. 2 Note how I imported while in Object Mode, ''imports and exports must be done in Object Mode'' 3 Before going on the next step I want you to check out the little eye icon to the right of the screen, left click it and it should hide / unhide the mesh. This is a useful function for the future. Good we have the toy that we want to replace, we are now going to import the teddy bear. Go to File>Import>Wavefront (.obj) then simply navigate to your teddy bear folder and double click the bear.obj to import it. At this point, if you get the above screen then congratulations! You are 1/4 of the way there. Summary of Importing #Save your blender file first #Make sure you are in Object Mode #Import the meshes 'Editing' Object > Toy Replacement After you have imported your meshes, you want to select your mesh and check for the following: 1. What type of "face" your mesh has in Edit Mode (Easily Fixable) 2. The integrity of the object's UV Map in UV Editing Mode (Could cause potential problems) ---- '1. What type of "face" your mesh has in Edit Mode' With the Teddy Bear selected, press TAB to go into "Edit Mode". You should see that there are a lot of "squares" that cover your entire mesh shape. These are faces and they are referred to as quads. Without going into details, the game will only accept meshes with "triangle" faces. To convert the teddy bear from quad to triangle do the following: with the mesh selected, and while in Edit Mode, press CTRL + T, this will "triangulate" all of the mesh's faces. Good, now we have a mesh that the game will accept, lets move on the next checklist, the uv map. '2. The integrity of the object's UV Map in UV Editing Mode' First, press TAB and go back to Object Mode. Next, go towards the top of your screen, click the drop down button and click UV Editing. You should get the following screen: The left side is where the UV Editing Screen, the right side is the mesh screen. There is nothing at the moment because the texture and mesh are not linked. Now do the following: With your cursor on the right side of the screen, press TAB. You should now see the UV Map pop up on the left side. Note the mesh screen is currently in EDIT MODE. Now go towards the bottom left of the screen (the UV Editing side) and click image>open image. Navigate to your teddy bear folder and double click the ToonTeddy.jpg You might need to zoom out a bit on the UV Editing Screen. You should get something similiar to below: Good, it looks like the UV Map and the textures fit. At this point your done with UV Edit, before we move on however, I want you to go back to images>save as image and choose .png (the rest of the options you can leave alone) this is because we will be needing a .png texture file later. Just save it to a place that you remember. Now go towards the top of the screen, select the drop down box and choose default. At this point, you should do 2 things. 1. Go to the icon next to edit mode / object mode (whichever one your in) and select "Texture" under viewport shading. 2. Right click on lamp and delete it (Step 4a). Next go to object mode and you should now see something like the screen below (Step 4b): At this point, I recommend you observe the size of the toy compared to the size of the teddy bear. The size of the toy that you see in Blender is the "default toy size" in-game. We are now going to scale the toy so it is invisible, after all we're replacing the toy with the teddy bear. Now remember the little eye icon that hides meshes? 1. Hide the Teddy Bear mesh so we can have a better view of the toy (corn). Now select the toy, go into edit mode, press "S" and move your mouse to scale the corn. Left Click to finish scaling. We want to scale it till it is pratically invisible. Basically Press S, move your mouse towards the toy, left click, repeat. Good, now the toy is effectively invisible. Lets Un-Hide the bear mesh. Go to rotation and enter -90 into the Y coordinate. The reason for this is because all toys by default are "side ways" hence, by rotating the teddy bear, we ensure when we use the toy in-game, it will be upright by default. Almost there, now I want you to to make sure your in Object Mode. Then Left Click the Teddy Bear, then HOLD SHIFT and Left Click the tool_mesh. Then go to Object and select Join (or press CTRL + J). You should get the following: NOTE: '(Check picture below) After joining the two objects, click the icon shown below (#1), and make sure the Map: says UV0 and the highlighted area is not red. If it says something other than UV0 or it is red. You messed up the UV Map somewhere and you need to re-do the editing section. (Or else your texture will be messed up after you export it in-game). ' ''' '''At this point, if you get the above screen then congratulations! You are 2/4 of the way there. Summary of Editing #Check the Mesh has triangulated faces #Make sure the mesh is linked to a texture via UV Editing (and it looks ok) #Re-Size the toy so it is invisible #Rotate the Mesh Y: -90° #Left Click the Object first, then Shift + Left Click the toy mesh and click join (CTRL + J) #Check the UV Map and make sure it says UV0 and looks like the picture above 'Exporting' Object > Toy Replacement Go towards the left side of your screen, under the Importer Tool, select export and make sure you have the following things checked. Click Generate, you should have gotten a *******.Tool0009.p001.txx as well as a Folder called the same (without the .txx of course). Remember where these are. We will be coming back to them in the next section. Congratulations, that wasn't so hard was it? :P You are 3/4 of the way there! 'Post-Exporting' Object > Toy Replacement Navigate to your \Archives\2.114.001_original\Folders (Yours might be called slightly differently depending on how you setup your TKM17 to Blender Add-On. However these folders themselves should still be named the same.) Copy and Paste the tool0009 and the tool0009.Tex032M folder to your desktop If you are curious and explored each of the folder, you will find that the tool0009 folder contains a tool09.bsb file, this is basically the "mesh" file. On the other hand the tool0009.Tex032M folder contains the texture and .txf files.These files are the original corn mesh files and texture. Remember the Modded tool09 files from the previous section? I want you to go to the folder, and copy the modded tool09.bsb into the original tool09 folder on your desktop. Remember the Teddy Bear.png texture file we saved awhile back in the Editing Section? Go to the Tex032M folder and move that file in there and re-name it to tool_dildo09. Afterwards delete the .jp2 file. Almost there, I want you to open up your BSB Tool and decode the tool09.bsb file on your desktop (the modded teddy bear one) with the following settings: Go to the folder, right click the decoded tool09.bs file and go to Open With>Note Pad. Once it is open, press CTRL + F type in sphere... ...and change it to the following coordinates: (3.086155175e-006, 7.148627788e-007, -9.999999975e-007, 36.09924316) Go to file>save and close the notepad. Go back to your BSB Tool and press encode this time. Select the tool09.bs file and use the following options: Now, open the Txx encoder/decoder and select the txxgui.exe. Use these settings: Go back to process, and click "Select Directory". Hold CTRL and click the tool09 folder and the tool09.Tex032M folder. Click Encode. You should now have created 2 .txx files at the same place where you had your tool0009 and tool0009.Tex032M folders. Just move these 2 new files to your archives and load up the game. In the game, go to the pose-editor. Afterwards, go to toys, connect it to free, and select corn and you should have the following screen: If you got the picture shown above, than congratulations you have just learned the basics of importing, editing, and exporting meshes into the game! 'F.A.Q.' UV Map Solutions Below is a solution that could fix your UV Map errors: 1) load the tool 2) Import an obj file at this point both, the tool and the imported file have an UV map named UVO 3) delete the UV map of the imported obj file. (can be done in "object data"), this way conflicts between the two UV-maps were avoided. 4) resize the obj file to the size you want 5) now join obj mesh to the tool (maybe here is a small error in your tutorial: selecting the objects worked with RMB in the 3D-View and with LMB in the Outliner) 6) edit the uv map ... 'Tips and Hints' '''pandabear7413 '''This is a great tutorial (the best I've found) but there were a few things I needed to add/change to make my toys work and look properly. If you’re having issue these may help: *Resize/reposition your toy BEFORE you join it to the imported toy from the game. I've found that if I try to resize/reposition after the join those changes are ignored by the game. I.e., you see the changes in Blender but not in the game. *Before joining your new toy object to the original toy object from the game, change the new toy object’s UV map name from the default (usually ‘UVMap’) to ‘UV0’ (That’s a zero, not the letter ‘0’). That way it’s the same name as the UV map of the original toy and there won’t be a conflict during the join. This is done through the object’s “Object Data” in the Blender “Properties” view. *Instead of resizing the original toy (corn) until it's practically invisible, I just delete the original toy after the Join. This seems to preserve size better for me, although johnnyutah says this can sometimes cause problems (see the FAQs on the original post on the forum). If you do want to delete it, here's how: **Join the new toy to the original as described in this tutorial (don't bother resizing the original toy, leave it as is) **In Blender, switch to Edit Mode (press the Tab key) **Press the A key to deselect all objects, then right click on the original toy to select it **Press the Delete key and delete the original toy **Switch to Object Mode (Tab key) **Right click on the new toy to select it and you should able to export the new toy to the game now. NOTE: If your object now consists of several parts (objects), then you’ll want to join them together before you export. Just join them like you joined your new toy to the original toy before (select all parts, press Ctrl+J). It does not seem to matter what order you select the objects for this join. This only applies to Objects you imported that were originally composed of several parts. *I had lots of issues with the new toys’ textures (they were all distorted in the game) until I found this post about splitting the seams. If you’re having texture issues try it out: http://modsgarden.cc/index.php?topic=366.255;msg=59235